var express = require('express');
var router = express.Router();
var upload = require('./fileupload');

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index.ejs');
});



//文件上传服务
router.post('/upload', upload.single('avatar111'), function (req, res, next) {
  if (req.file) {
    res.send('文件上传成功')
    console.log(req.file);
    console.log(req.body);
  }
});
module.exports = router;



